@layout("/common/_container.html"){
<link href="https://pynnn.oss-cn-hangzhou.aliyuncs.com/followUp.css?v=20200628" rel="stylesheet">
<div class="ibox float-e-margins">
    <div style="background: #6090b8;color: white;padding: 5px 10px;">添加再随访</div>
    <div style="display: flex;padding: 20px 15px;">
        <div style="margin-right: 10px;">随访时间：</div>
        <div>
            <div style="border: 1px solid #999999;"><input type="text" id="revisitTime" onclick="laydate({istiem:true,format:'YYYY-MM-DD'})">
                <span class="glyphicon glyphicon-calendar" style="left: 6px;cursor: pointer" id="test25-1"></span>
            </div>
            <div style="margin-top: 5px;">
                <button class="btn btnBoxWhite btn1" type="button">三个月</button>
                <button class="btn btnBoxWhite btn2" type="button">半年</button>
                <button class="btn btnBoxWhite btn3" type="button">一年</button>
            </div>
        </div>
    </div>
    <div class="btnBox">
        <button class="btn" type="button" id="submission1">提交</button>
        <button class="btn btnBoxWhite" type="button" id="cancle" onclick="parent.layer.close(parent.layer.getFrameIndex(window.name))">取消</button>
    </div>
</div>
<script>
    $(function () {
        var date = new Date();
        var currentMonth = date.getMonth() + 1;
        if (currentMonth < 10) currentMonth = "0" + currentMonth;
        $("#revisitTime").val(date.getFullYear() + "-" + currentMonth + "-" + date.getDate())
    });
    $("#submission1").click(function () {
        var doctor= $("#doctor",parent.document).val();   //医生
        var createName= $("#doctorValue",parent.document).val();  //创建人
        var revisit= $("#revisit",parent.document).val();  //随访人员
        var remarks= $("#remarks",parent.document).val();   //随访内容
        //var revisitContent= $("#revisitContent",parent.document).val();   //随访结果
        var reservationsId= $("#reservationsId",parent.document).val();   //预约id
        var customerId= $("#customerId",parent.document).val();   //客户id
        var arrivalStore= $("#arrivalStore",parent.document).val();   //门诊
        var revisitTime= $("#revisitTime").val();   //随访时间
        $.ajax({
            url: Feng.ctxPath + "/doctorLooked/addDoctorContents",
            type: "post",
            data: {
                doctor: doctor,
                revisitTime: revisitTime,
                createName:createName,
                remarks: remarks,
                arrivalStore:arrivalStore,
                customerId:customerId,
                reservationsId: reservationsId,
                revisit:revisit
            },
            success: function (data) {
                Feng.success('操作成功!');
                $("#revisitTime",parent.document).val(revisitTime);
                window.parent.parent.FollowTableList.table.refresh();
                $('#cancel', parent.document).click();
            },
            error: function (data) {
                alert('没有权限，请联系管理员!');
            }
        });
    });
    $(".btn1").click(function () {
        var date = new Date();
        date.setMonth(date.getMonth() + 3, 1);
        $("#revisitTime").val(date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate())
    });
    $(".btn2").click(function () {
        var date = new Date();
        date.setMonth(date.getMonth() + 6, 1);
        $("#revisitTime").val(date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate())
    });
    $(".btn3").click(function () {
        var date = new Date();
        date.setFullYear(date.getFullYear() + 1);
        $("#revisitTime").val(date.getFullYear() + "-" + (date.getMonth() + 1) + "-" + date.getDate())
    })
</script>
@}